package com.example.demoorder.controller.api;

import com.alispring.cloud.demo.entity.Order;
import com.example.demoorder.bizservice.service.OrderService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;


/**
 * (Order)表控制层
 *
 * @author makejava
 * @since 2020-04-05 09:01:41
 */
@RestController
@RequestMapping("/api")
public class OrderController {
    /**
     * 服务对象
     */
    @Resource
    private OrderService orderService;

    /**
     * 通过主键查询单条数据
     *
     * @param id 主键
     * @return 单条数据
     */
    @GetMapping("selectOne")
    public Order selectOne(Long id) {
        return this.orderService.queryById(id);
    }


    @RequestMapping("/get")
    public Order select() {
        return orderService.queryById(444105272157585413L);
    }

}